import request from '@/utils/request'

// 查询调查列表列表
export function listSurveyList(query) {
  return request({
    url: '/survey/surveyList/list',
    method: 'get',
    params: query
  })
}

// 查询调查列表详细
export function getSurveyList(id) {
  return request({
    url: '/survey/surveyList/' + id,
    method: 'get'
  })
}

// 查询调查备注
export function getSurveyModifyremarks(id) {
  return request({
    url: '/survey/surveyList/Modifyremarks/' + id,
    method: 'get'
  })
}

// 新增调查列表
export function addSurveyList(data) {
  return request({
    url: '/survey/surveyList',
    method: 'post',
    data: data
  })
}

// 修改调查列表
export function updateSurveyList(data) {
  return request({
    url: '/survey/surveyList',
    method: 'put',
    data: data
  })
}

// 修改调查列表备注
export function updateremarkssurveyList(data) {
  return request({
    url: '/survey/surveyList/updateremarks',
    method: 'put',
    data: data
  })
}

// 删除调查列表
export function delSurveyList(id) {
  return request({
    url: '/survey/surveyList/' + id,
    method: 'delete'
  })
}

// 获取调查链接
export function getSurveyUrl(surveyTitle, surveyIp, username) {
  return request({
    url: `/survey/surveyList/questGoTo/${surveyTitle}/${surveyIp}/${username}`,
    method: "get"
  });
}

// 修改调查状态
export function updateSurveyReady(surveyTitle,surveyReady) {
  return request({
    url: `/survey/surveyList/upreday/${surveyTitle}/${surveyReady}`,
    method: 'get'
  })
}
